---- Conditions Guide ----

Conditions are rules that can be evaluated against different types of entities (cells, groups, factions, etc). These return a boolean value of "true" when the condition is meet. Otherwise return false. When chained together on a requirement list of comma separated conditions (e.g. "<condition1>","<condition2>"), all of them must be true for the requirement to pass. By default, conditions are evaluated against the base target unless a special operator is specified. For example, group conditions are evaluated by default against the target group unless an operator like [ANY_NEIGHBOR] is prefixed. In which case the condition will be evaluated against the neighbor groups of the target group.

- General condition operators -

[NOT] : A condition can be negated by prefixing [NOT] before the condition. A negated condition must be false to pass. Both the prefix and the condition must be enclosed together in quotes like this: "[NOT]<condition>"

[AND] : Two or more conditions can be evaluated together using the [AND] infix. In which case, all of the conditions within the conjunction must be true for the statement to pass. All of the conditions and infixes in the statement must be enclosed together in quotes like this: "<condition1>[AND]<condition2>([AND]<additional conditions>)"

[OR] : Two or more conditions can be evaluated together using the [OR] infix. In which case, if any of the conditions within the disjunction is true then the whole statement passes. All of the conditions and infixes in the statement must be enclosed together in quotes like this: "<condition1>[OR]<condition2>([OR]<additional conditions>)"

- Group condition operators -

[ANY_N_GROUP] : The target condition must be true for at least one neighbor cell group. The condition to be evaluated with this operator must be applicable to cell groups. Both the prefix and the condition must be enclosed together in quotes like this: "[ANY_N_GROUP]<condition>"

[ALL_N_GROUPS] : The target condition must be true for all neighbor cell groups. The condition to be evaluated with this operator must be applicable to cell groups. Both the prefix and the condition must be enclosed together in quotes like this: "[ALL_N_GROUPS]<condition>"

[AT_LEAST_N_GROUPS:<count>] : The target condition must be true for at least <count> cell groups. The condition to be evaluated with this operator must be applicable to cell groups. Both the prefix and the condition must be enclosed together in quotes like this: "[ALL_N_GROUPS]<condition>"

- Cell condition operators -

[ANY_N_CELL] : The target condition must be true for at least one neighbor terrain cell. The condition to be evaluated with this operator must be applicable to terrain cells. Both the prefix and the condition must be enclosed together in quotes like this: "[ANY_N_CELL]<condition>"

[ALL_N_CELLS] : The target condition must be true for all neighbor terrain cells. The condition to be evaluated with this operator must be applicable to terrain cells. Both the prefix and the condition must be enclosed together in quotes like this: "[ALL_N_CELLS]<condition>"

[AT_LEAST_N_CELLS:<count>] : The target condition must be true for at least <count> terrain cells. The condition to be evaluated with this operator must be applicable to terrain cells. Both the prefix and the condition must be enclosed together in quotes like this: "[ALL_N_GROUPS]<condition>"


Operators can be uses together using parenthesis to set modifier priority (values between parenthesis evaluate first).
Example: "[NOT](<condition1>[OR]([ANY_N_GROUP]<condition2>)[OR]<condition3>)"

---

Here's a list of the current types of conditions (more to be added in future versions) and how they work:

- "group_has_knowledge"
    Tests if a group currently possesses a particular knowledge identified by id, and the knowledge level is equal or greater than the specified value (optional integer value between 0 and 10000). The format of the constraint is as follows: "group_has_knowledge:<knowledge_id>(,<level>)"

    Examples: "group_has_knowledge:agriculture_knowledge", "group_has_knowledge:shipbuilding_knowledge,3"

- "group_population"
    Tests if a group currently possesses at least certain amount of population. The value can be any quantity between 1 and 2,147,483,647. The format of the constraint is as follows: "group_population:<quantity>"

    Examples: "group_population:10000"

- "cell_altitude"
    Tests if a cell has an altitude (in meters) equal or greater than the specified value (value between -15000 and 15000). The format of the constraint is as follows: "cell_altitude:<min_altitude>"

    Examples: "cell_altitude:-1000", "cell_altitude:4000"

- "cell_rainfall"
    Tests if a cell has a yearly rainfall (in mm) equal or greater than the specified value (value between 0 and 13000). The format of the constraint is as follows: "cell_rainfall:<min_rainfall>"

    Examples: "cell_rainfall:100", "cell_rainfall:5000"

- "cell_temperature"
    Tests if a cell has a yearly average temperature (in centigrades) equal or greater than the specified value (value between -63.7 and 43.7). The format of the constraint is as follows: "cell_temperature:<min_temperature>"

    Examples: "cell_temperature:-15", "cell_temperature:10"

- "cell_accessibility"
    Tests if a cell has an accessibility value (i.e. how accessible the terrain is) equal or greater than 0.01 or than the specified value (optional value between 0 and 1). The format of the constraint is as follows: "cell_accessibility(:<min_accessibility>)"

    Examples: "cell_accessibility", "cell_accessibility:0.2"

- "cell_arability"
    Tests if a cell has an arability value (i.e. how arable the land is) equal or greater than 0.01 or than the specified value (optional value between 0 and 1). The format of the constraint is as follows: "cell_arability(:<min_arability>)"

    Examples: "cell_arability", "cell_arability:0.6"

- "cell_foraging_capacity"
    Tests if a cell has an foraging capacity value (i.e. how many resources can be extracted through foraging) equal or greater than 0.01 or than the specified value (optional value between 0 and 1). The format of the constraint is as follows: "cell_foraging_capacity(:<min_foraging_capacity>)"

    Examples: "cell_foraging_capacity", "cell_foraging_capacity:0.5"

- "cell_survivability"
    Tests if a cell has an survivability value (i.e. how easy is for humans to survive on that cell) equal or greater than 0.01 or than the specified value (optional value between 0 and 1). The format of the constraint is as follows: "cell_survivability(:<min_survivability>)"

    Examples: "cell_survivability", "cell_survivability:0.6"

- "cell_layer_value"
    Tests if a cell has a layer value equal or greater than the specified value (value between 0 and the layer`s max possible value). The format of the constraint is as follows: "cell_layer_value:<layer_id>,<min_presence>"

    Examples: "cell_layer_value:mycosystem,20", "cell_layer_value:necrosilica,50"

- "cell_hilliness"
    Tests if a cell has an hilliness value (i.e. how hilly the terrain is) equal or greater than 0.01 or than the specified value (optional value between 0 and 1). The format of the constraint is as follows: "cell_hilliness(:<min_hilliness>)"

    Examples: "cell_hilliness", "cell_hilliness:0.4"

- "cell_flowing_water"
    Tests if a cell has an amount of flowing water (in mm) equal or greater than the specified value (value between 1 and 1000000).  The format of the constraint is as follows: "cell_flowing_water:<cell_flowing_water>"

    Examples: "cell_flowing_water:100", "cell_flowing_water:2000"

- "cell_biome_presence"
    Tests if a cell has an biome relative presence value (i.e. percentage of area in cell covered by such biome) equal or greater than 0.01 or than the specified value (optional value between 0 and 1). The format of the constraint is as follows: "cell_biome_presence:<biome_id>(,<min_presence>)"

    Examples: "cell_biome_presence:forest", "cell_biome_presence:desert,0.3"

- "cell_biome_most_present"
    Tests if a biome is the most present in a cell (i.e. greatest occupied area). The format of the constraint is as follows: "cell_biome_most_present:<biome_id>"

    Examples: "cell_biome_most_present:grassland", "cell_biome_most_present:tundra"

- "cell_biome_type_presence"
    Tests if a cell has a total presence of biomes of the specified type equal or greater than 0.01 or than the specified value (optional value between 0 and 1. See note 1). The format of the constraint is as follows: "cell_biome_type_presence:<biome_type>(,<min_presence>)"

    Examples: "cell_biome_type_presence:land", "cell_biome_type_presence:water,0.5"

- "cell_biome_trait_presence"
    Tests if a cell has a biome trait presence (ie. 'wood', 'sea') equal or greater than 0.01 or than the specified value (optional value between 0 and 1). The format of the constraint is as follows: "cell_biome_trait:<biome_trait>(,<min_value>)"

    Examples: "cell_biome_trait_presence:sea", "cell_biome_trait_presence:wood,0.4"


NOTES:
1.  The parameter has a precision limit of two decimal places (eg. 0.01 is the smallest value possible above 0, and 0.99 the largest possible below 1)

--
